<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>XenC: include/kenlm/util/double-conversion/double-conversion.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">XenC
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Open-source tool for data selection in NLP</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_5417fc49d29c4cfca6bc3f52c9c7deba.html">kenlm</a></li><li class="navelem"><a class="el" href="dir_9ec25de6763e2dc47109730f881b7e3e.html">util</a></li><li class="navelem"><a class="el" href="dir_5fd0dc67f55ed56e6f450361f3921d3b.html">double-conversion</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">double-conversion.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="double-conversion_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// Copyright 2012 the V8 project authors. All rights reserved.</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// Redistribution and use in source and binary forms, with or without</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// modification, are permitted provided that the following conditions are</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// met:</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//     * Redistributions of source code must retain the above copyright</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//       notice, this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//     * Redistributions in binary form must reproduce the above</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">//       copyright notice, this list of conditions and the following</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//       disclaimer in the documentation and/or other materials provided</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">//       with the distribution.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//     * Neither the name of Google Inc. nor the names of its</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">//       contributors may be used to endorse or promote products derived</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//       from this software without specific prior written permission.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="utils_8h.html">utils.h</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacedouble__conversion.html">double_conversion</a> {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html">   35</a></span>&#160;<span class="keyword">class </span><a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html">DoubleToStringConverter</a> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  <span class="comment">// When calling ToFixed with a double &gt; 10^kMaxFixedDigitsBeforePoint</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  <span class="comment">// or a requested_digits parameter &gt; kMaxFixedDigitsAfterPoint then the</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  <span class="comment">// function returns false.</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a3f2f70cf718ff577329b95f3b8de2375">   40</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a3f2f70cf718ff577329b95f3b8de2375">kMaxFixedDigitsBeforePoint</a> = 60;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a1e0a61262e4277a213e3076dff0de8a7">   41</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a1e0a61262e4277a213e3076dff0de8a7">kMaxFixedDigitsAfterPoint</a> = 60;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  <span class="comment">// When calling ToExponential with a requested_digits</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  <span class="comment">// parameter &gt; kMaxExponentialDigits then the function returns false.</span></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#af05a3e2ea40c5deb8db7d17f5363b31d">   45</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#af05a3e2ea40c5deb8db7d17f5363b31d">kMaxExponentialDigits</a> = 120;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  <span class="comment">// When calling ToPrecision with a requested_digits</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <span class="comment">// parameter &lt; kMinPrecisionDigits or requested_digits &gt; kMaxPrecisionDigits</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  <span class="comment">// then the function returns false.</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a49052275a0e31cd9219f645b92e0fda8">   50</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a49052275a0e31cd9219f645b92e0fda8">kMinPrecisionDigits</a> = 1;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a7fd15aba1b4cc7dc1f630e6ce5f88f4e">   51</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a7fd15aba1b4cc7dc1f630e6ce5f88f4e">kMaxPrecisionDigits</a> = 120;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5">   53</a></span>&#160;  <span class="keyword">enum</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5">Flags</a> {</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa23cb197875ffb876257ffa1749e266d">   54</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa23cb197875ffb876257ffa1749e266d">NO_FLAGS</a> = 0,</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a359373be91541fe7c9323761e667e0d7">   55</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a359373be91541fe7c9323761e667e0d7">EMIT_POSITIVE_EXPONENT_SIGN</a> = 1,</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa52a8d564ea15c218057ed4ccde33680">   56</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa52a8d564ea15c218057ed4ccde33680">EMIT_TRAILING_DECIMAL_POINT</a> = 2,</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a7aa7eb79de1512c515e0cef5fd92706b">   57</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a7aa7eb79de1512c515e0cef5fd92706b">EMIT_TRAILING_ZERO_AFTER_POINT</a> = 4,</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a65983b38e8e766c8de54054d392c1a74">   58</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a65983b38e8e766c8de54054d392c1a74">UNIQUE_ZERO</a> = 8</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  };</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  <span class="comment">// Flags should be a bit-or combination of the possible Flags-enum.</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  <span class="comment">//  - NO_FLAGS: no special flags.</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="comment">//  - EMIT_POSITIVE_EXPONENT_SIGN: when the number is converted into exponent</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <span class="comment">//    form, emits a &#39;+&#39; for positive exponents. Example: 1.2e+2.</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <span class="comment">//  - EMIT_TRAILING_DECIMAL_POINT: when the input number is an integer and is</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <span class="comment">//    converted into decimal format then a trailing decimal point is appended.</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  <span class="comment">//    Example: 2345.0 is converted to &quot;2345.&quot;.</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="comment">//  - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <span class="comment">//    emits a trailing &#39;0&#39;-character. This flag requires the</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <span class="comment">//    EXMIT_TRAILING_DECIMAL_POINT flag.</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  <span class="comment">//    Example: 2345.0 is converted to &quot;2345.0&quot;.</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <span class="comment">//  - UNIQUE_ZERO: &quot;-0.0&quot; is converted to &quot;0.0&quot;.</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  <span class="comment">// Infinity symbol and nan_symbol provide the string representation for these</span></div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <span class="comment">// special values. If the string is NULL and the special value is encountered</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <span class="comment">// then the conversion functions return false.</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <span class="comment">// The exponent_character is used in exponential representations. It is</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <span class="comment">// usually &#39;e&#39; or &#39;E&#39;.</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="comment">// When converting to the shortest representation the converter will</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  <span class="comment">// represent input numbers in decimal format if they are in the interval</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  <span class="comment">// [10^decimal_in_shortest_low; 10^decimal_in_shortest_high[</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  <span class="comment">//    (lower boundary included, greater boundary excluded).</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  <span class="comment">// Example: with decimal_in_shortest_low = -6 and</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  <span class="comment">//               decimal_in_shortest_high = 21:</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="comment">//   ToShortest(0.000001)  -&gt; &quot;0.000001&quot;</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  <span class="comment">//   ToShortest(0.0000001) -&gt; &quot;1e-7&quot;</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="comment">//   ToShortest(111111111111111111111.0)  -&gt; &quot;111111111111111110000&quot;</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="comment">//   ToShortest(100000000000000000000.0)  -&gt; &quot;100000000000000000000&quot;</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="comment">//   ToShortest(1111111111111111111111.0) -&gt; &quot;1.1111111111111111e+21&quot;</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="comment">// When converting to precision mode the converter may add</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  <span class="comment">// max_leading_padding_zeroes before returning the number in exponential</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="comment">// format.</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  <span class="comment">// Example with max_leading_padding_zeroes_in_precision_mode = 6.</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  <span class="comment">//   ToPrecision(0.0000012345, 2) -&gt; &quot;0.0000012&quot;</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  <span class="comment">//   ToPrecision(0.00000012345, 2) -&gt; &quot;1.2e-7&quot;</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <span class="comment">// Similarily the converter may add up to</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="comment">// max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <span class="comment">// returning an exponential representation. A zero added by the</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  <span class="comment">// EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit.</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  <span class="comment">// Examples for max_trailing_padding_zeroes_in_precision_mode = 1:</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="comment">//   ToPrecision(230.0, 2) -&gt; &quot;230&quot;</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="comment">//   ToPrecision(230.0, 2) -&gt; &quot;230.&quot;  with EMIT_TRAILING_DECIMAL_POINT.</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="comment">//   ToPrecision(230.0, 2) -&gt; &quot;2.3e2&quot; with EMIT_TRAILING_ZERO_AFTER_POINT.</span></div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ac57e7c75011add9f0e791250930d9eb1">  107</a></span>&#160;  <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac57e7c75011add9f0e791250930d9eb1">DoubleToStringConverter</a>(<span class="keywordtype">int</span> flags,</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                          <span class="keyword">const</span> <span class="keywordtype">char</span>* infinity_symbol,</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                          <span class="keyword">const</span> <span class="keywordtype">char</span>* nan_symbol,</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                          <span class="keywordtype">char</span> exponent_character,</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;                          <span class="keywordtype">int</span> decimal_in_shortest_low,</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                          <span class="keywordtype">int</span> decimal_in_shortest_high,</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                          <span class="keywordtype">int</span> max_leading_padding_zeroes_in_precision_mode,</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;                          <span class="keywordtype">int</span> max_trailing_padding_zeroes_in_precision_mode)</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;      : flags_(flags),</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        infinity_symbol_(infinity_symbol),</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        nan_symbol_(nan_symbol),</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        exponent_character_(exponent_character),</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        decimal_in_shortest_low_(decimal_in_shortest_low),</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        decimal_in_shortest_high_(decimal_in_shortest_high),</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        max_leading_padding_zeroes_in_precision_mode_(</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            max_leading_padding_zeroes_in_precision_mode),</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        max_trailing_padding_zeroes_in_precision_mode_(</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            max_trailing_padding_zeroes_in_precision_mode) {</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="comment">// When &#39;trailing zero after the point&#39; is set, then &#39;trailing point&#39;</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="comment">// must be set too.</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <a class="code" href="utils_8h.html#a1dfb2cb545fa51edb2760047aa4ce45f">ASSERT</a>(((flags &amp; <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa52a8d564ea15c218057ed4ccde33680">EMIT_TRAILING_DECIMAL_POINT</a>) != 0) ||</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        !((flags &amp; <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a7aa7eb79de1512c515e0cef5fd92706b">EMIT_TRAILING_ZERO_AFTER_POINT</a>) != 0));</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="comment">// Returns a converter following the EcmaScript specification.</span></div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html">DoubleToStringConverter</a>&amp; <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a7720bd00f846c4b611ce29ffabe38bdb">EcmaScriptConverter</a>();</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  <span class="comment">// Computes the shortest string of digits that correctly represent the input</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  <span class="comment">// number. Depending on decimal_in_shortest_low and decimal_in_shortest_high</span></div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <span class="comment">// (see constructor) it then either returns a decimal representation, or an</span></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  <span class="comment">// exponential representation.</span></div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  <span class="comment">// Example with decimal_in_shortest_low = -6,</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <span class="comment">//              decimal_in_shortest_high = 21,</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  <span class="comment">//              EMIT_POSITIVE_EXPONENT_SIGN activated, and</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;  <span class="comment">//              EMIT_TRAILING_DECIMAL_POINT deactived:</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  <span class="comment">//   ToShortest(0.000001)  -&gt; &quot;0.000001&quot;</span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  <span class="comment">//   ToShortest(0.0000001) -&gt; &quot;1e-7&quot;</span></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;  <span class="comment">//   ToShortest(111111111111111111111.0)  -&gt; &quot;111111111111111110000&quot;</span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;  <span class="comment">//   ToShortest(100000000000000000000.0)  -&gt; &quot;100000000000000000000&quot;</span></div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;  <span class="comment">//   ToShortest(1111111111111111111111.0) -&gt; &quot;1.1111111111111111e+21&quot;</span></div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;  <span class="comment">// Note: the conversion may round the output if the returned string</span></div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  <span class="comment">// is accurate enough to uniquely identify the input-number.</span></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  <span class="comment">// For example the most precise representation of the double 9e59 equals</span></div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <span class="comment">// &quot;899999999999999918767229449717619953810131273674690656206848&quot;, but</span></div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;  <span class="comment">// the converter will return the shorter (but still correct) &quot;9e59&quot;.</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;  <span class="comment">// Returns true if the conversion succeeds. The conversion always succeeds</span></div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="comment">// except when the input value is special and no infinity_symbol or</span></div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;  <span class="comment">// nan_symbol has been given to the constructor.</span></div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a648b150d55851704f430fa820ab035ea">  157</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a648b150d55851704f430fa820ab035ea">ToShortest</a>(<span class="keywordtype">double</span> value, <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder)<span class="keyword"> const </span>{</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">return</span> ToShortestIeeeNumber(value, result_builder, <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3adf991f485278f5c50e89fcb4ff279be1">SHORTEST</a>);</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;  <span class="comment">// Same as ToShortest, but for single-precision floats.</span></div><div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a394128cc38ee249932d9453ffa2a08e1">  162</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a394128cc38ee249932d9453ffa2a08e1">ToShortestSingle</a>(<span class="keywordtype">float</span> value, <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder)<span class="keyword"> const </span>{</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="keywordflow">return</span> ToShortestIeeeNumber(value, result_builder, <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3a1f2b5709ed846f25c003bfc005257251">SHORTEST_SINGLE</a>);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  }</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  <span class="comment">// Computes a decimal representation with a fixed number of digits after the</span></div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  <span class="comment">// decimal point. The last emitted digit is rounded.</span></div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  <span class="comment">// Examples:</span></div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  <span class="comment">//   ToFixed(3.12, 1) -&gt; &quot;3.1&quot;</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  <span class="comment">//   ToFixed(3.1415, 3) -&gt; &quot;3.142&quot;</span></div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;  <span class="comment">//   ToFixed(1234.56789, 4) -&gt; &quot;1234.5679&quot;</span></div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;  <span class="comment">//   ToFixed(1.23, 5) -&gt; &quot;1.23000&quot;</span></div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  <span class="comment">//   ToFixed(0.1, 4) -&gt; &quot;0.1000&quot;</span></div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;  <span class="comment">//   ToFixed(1e30, 2) -&gt; &quot;1000000000000000019884624838656.00&quot;</span></div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  <span class="comment">//   ToFixed(0.1, 30) -&gt; &quot;0.100000000000000005551115123126&quot;</span></div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  <span class="comment">//   ToFixed(0.1, 17) -&gt; &quot;0.10000000000000001&quot;</span></div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;  <span class="comment">// If requested_digits equals 0, then the tail of the result depends on</span></div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  <span class="comment">// the EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT.</span></div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;  <span class="comment">// Examples, for requested_digits == 0,</span></div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  <span class="comment">//   let EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT be</span></div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  <span class="comment">//    - false and false: then 123.45 -&gt; 123</span></div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  <span class="comment">//                             0.678 -&gt; 1</span></div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  <span class="comment">//    - true and false: then 123.45 -&gt; 123.</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  <span class="comment">//                            0.678 -&gt; 1.</span></div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  <span class="comment">//    - true and true: then 123.45 -&gt; 123.0</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  <span class="comment">//                           0.678 -&gt; 1.0</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  <span class="comment">// Returns true if the conversion succeeds. The conversion always succeeds</span></div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;  <span class="comment">// except for the following cases:</span></div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  <span class="comment">//   - the input value is special and no infinity_symbol or nan_symbol has</span></div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  <span class="comment">//     been provided to the constructor,</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="comment">//   - &#39;value&#39; &gt; 10^kMaxFixedDigitsBeforePoint, or</span></div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <span class="comment">//   - &#39;requested_digits&#39; &gt; kMaxFixedDigitsAfterPoint.</span></div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  <span class="comment">// The last two conditions imply that the result will never contain more than</span></div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;  <span class="comment">// 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters</span></div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  <span class="comment">// (one additional character for the sign, and one for the decimal point).</span></div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a67a05fb2ae7722ac4ef220d9b1208c0b">ToFixed</a>(<span class="keywordtype">double</span> value,</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;               <span class="keywordtype">int</span> requested_digits,</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;               <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder) <span class="keyword">const</span>;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="comment">// Computes a representation in exponential format with requested_digits</span></div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  <span class="comment">// after the decimal point. The last emitted digit is rounded.</span></div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <span class="comment">// If requested_digits equals -1, then the shortest exponential representation</span></div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  <span class="comment">// is computed.</span></div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;  <span class="comment">// Examples with EMIT_POSITIVE_EXPONENT_SIGN deactivated, and</span></div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  <span class="comment">//               exponent_character set to &#39;e&#39;.</span></div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  <span class="comment">//   ToExponential(3.12, 1) -&gt; &quot;3.1e0&quot;</span></div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  <span class="comment">//   ToExponential(5.0, 3) -&gt; &quot;5.000e0&quot;</span></div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;  <span class="comment">//   ToExponential(0.001, 2) -&gt; &quot;1.00e-3&quot;</span></div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;  <span class="comment">//   ToExponential(3.1415, -1) -&gt; &quot;3.1415e0&quot;</span></div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;  <span class="comment">//   ToExponential(3.1415, 4) -&gt; &quot;3.1415e0&quot;</span></div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;  <span class="comment">//   ToExponential(3.1415, 3) -&gt; &quot;3.142e0&quot;</span></div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;  <span class="comment">//   ToExponential(123456789000000, 3) -&gt; &quot;1.235e14&quot;</span></div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;  <span class="comment">//   ToExponential(1000000000000000019884624838656.0, -1) -&gt; &quot;1e30&quot;</span></div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;  <span class="comment">//   ToExponential(1000000000000000019884624838656.0, 32) -&gt;</span></div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;  <span class="comment">//                     &quot;1.00000000000000001988462483865600e30&quot;</span></div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;  <span class="comment">//   ToExponential(1234, 0) -&gt; &quot;1e3&quot;</span></div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;  <span class="comment">// Returns true if the conversion succeeds. The conversion always succeeds</span></div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;  <span class="comment">// except for the following cases:</span></div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;  <span class="comment">//   - the input value is special and no infinity_symbol or nan_symbol has</span></div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;  <span class="comment">//     been provided to the constructor,</span></div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;  <span class="comment">//   - &#39;requested_digits&#39; &gt; kMaxExponentialDigits.</span></div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  <span class="comment">// The last condition implies that the result will never contain more than</span></div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;  <span class="comment">// kMaxExponentialDigits + 8 characters (the sign, the digit before the</span></div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="comment">// decimal point, the decimal point, the exponent character, the</span></div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;  <span class="comment">// exponent&#39;s sign, and at most 3 exponent digits).</span></div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac62cdd85f3b6dbdea23788717f702752">ToExponential</a>(<span class="keywordtype">double</span> value,</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                     <span class="keywordtype">int</span> requested_digits,</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                     <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder) <span class="keyword">const</span>;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;  <span class="comment">// Computes &#39;precision&#39; leading digits of the given &#39;value&#39; and returns them</span></div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;  <span class="comment">// either in exponential or decimal format, depending on</span></div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;  <span class="comment">// max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the</span></div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;  <span class="comment">// constructor).</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;  <span class="comment">// The last computed digit is rounded.</span></div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;  <span class="comment">// Example with max_leading_padding_zeroes_in_precision_mode = 6.</span></div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  <span class="comment">//   ToPrecision(0.0000012345, 2) -&gt; &quot;0.0000012&quot;</span></div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  <span class="comment">//   ToPrecision(0.00000012345, 2) -&gt; &quot;1.2e-7&quot;</span></div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  <span class="comment">// Similarily the converter may add up to</span></div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  <span class="comment">// max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid</span></div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;  <span class="comment">// returning an exponential representation. A zero added by the</span></div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;  <span class="comment">// EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit.</span></div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;  <span class="comment">// Examples for max_trailing_padding_zeroes_in_precision_mode = 1:</span></div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;  <span class="comment">//   ToPrecision(230.0, 2) -&gt; &quot;230&quot;</span></div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  <span class="comment">//   ToPrecision(230.0, 2) -&gt; &quot;230.&quot;  with EMIT_TRAILING_DECIMAL_POINT.</span></div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;  <span class="comment">//   ToPrecision(230.0, 2) -&gt; &quot;2.3e2&quot; with EMIT_TRAILING_ZERO_AFTER_POINT.</span></div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;  <span class="comment">// Examples for max_trailing_padding_zeroes_in_precision_mode = 3, and no</span></div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;  <span class="comment">//    EMIT_TRAILING_ZERO_AFTER_POINT:</span></div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  <span class="comment">//   ToPrecision(123450.0, 6) -&gt; &quot;123450&quot;</span></div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;  <span class="comment">//   ToPrecision(123450.0, 5) -&gt; &quot;123450&quot;</span></div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  <span class="comment">//   ToPrecision(123450.0, 4) -&gt; &quot;123500&quot;</span></div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;  <span class="comment">//   ToPrecision(123450.0, 3) -&gt; &quot;123000&quot;</span></div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;  <span class="comment">//   ToPrecision(123450.0, 2) -&gt; &quot;1.2e5&quot;</span></div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;  <span class="comment">// Returns true if the conversion succeeds. The conversion always succeeds</span></div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;  <span class="comment">// except for the following cases:</span></div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;  <span class="comment">//   - the input value is special and no infinity_symbol or nan_symbol has</span></div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;  <span class="comment">//     been provided to the constructor,</span></div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;  <span class="comment">//   - precision &lt; kMinPericisionDigits</span></div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  <span class="comment">//   - precision &gt; kMaxPrecisionDigits</span></div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;  <span class="comment">// The last condition implies that the result will never contain more than</span></div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;  <span class="comment">// kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the</span></div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;  <span class="comment">// exponent character, the exponent&#39;s sign, and at most 3 exponent digits).</span></div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ab0e236bbd5927c703a1bc13692278def">ToPrecision</a>(<span class="keywordtype">double</span> value,</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;                   <span class="keywordtype">int</span> precision,</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;                   <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder) <span class="keyword">const</span>;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3">  274</a></span>&#160;  <span class="keyword">enum</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3">DtoaMode</a> {</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <span class="comment">// Produce the shortest correct representation.</span></div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="comment">// For example the output of 0.299999999999999988897 is (the less accurate</span></div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="comment">// but correct) 0.3.</span></div><div class="line"><a name="l00278"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3adf991f485278f5c50e89fcb4ff279be1">  278</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3adf991f485278f5c50e89fcb4ff279be1">SHORTEST</a>,</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="comment">// Same as SHORTEST, but for single-precision floats.</span></div><div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3a1f2b5709ed846f25c003bfc005257251">  280</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3a1f2b5709ed846f25c003bfc005257251">SHORTEST_SINGLE</a>,</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="comment">// Produce a fixed number of digits after the decimal point.</span></div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="comment">// For instance fixed(0.1, 4) becomes 0.1000</span></div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="comment">// If the input number is big, the output will be big.</span></div><div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3ac31849518ec61610019f7a307857b8f1">  284</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3ac31849518ec61610019f7a307857b8f1">FIXED</a>,</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <span class="comment">// Fixed number of digits (independent of the decimal point).</span></div><div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3aa19c7e5b00f4cb5fe99b46431c4b22da">  286</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3aa19c7e5b00f4cb5fe99b46431c4b22da">PRECISION</a></div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;  };</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;  <span class="comment">// The maximal number of digits that are needed to emit a double in base 10.</span></div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;  <span class="comment">// A higher precision can be achieved by using more digits, but the shortest</span></div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;  <span class="comment">// accurate representation of any double will never use more digits than</span></div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;  <span class="comment">// kBase10MaximalLength.</span></div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;  <span class="comment">// Note that DoubleToAscii null-terminates its input. So the given buffer</span></div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;  <span class="comment">// should be at least kBase10MaximalLength + 1 characters long.</span></div><div class="line"><a name="l00295"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_double_to_string_converter.html#ae2c96a663b04b018b25edc5237977795">  295</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ae2c96a663b04b018b25edc5237977795">kBase10MaximalLength</a> = 17;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;  <span class="comment">// Converts the given double &#39;v&#39; to ascii. &#39;v&#39; must not be NaN, +Infinity, or</span></div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  <span class="comment">// -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to &#39;v&#39;</span></div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;  <span class="comment">// after it has been casted to a single-precision float. That is, in this</span></div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  <span class="comment">// mode static_cast&lt;float&gt;(v) must not be NaN, +Infinity or -Infinity.</span></div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;  <span class="comment">// The result should be interpreted as buffer * 10^(point-length).</span></div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;  <span class="comment">// The output depends on the given mode:</span></div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;  <span class="comment">//  - SHORTEST: produce the least amount of digits for which the internal</span></div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  <span class="comment">//   identity requirement is still satisfied. If the digits are printed</span></div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;  <span class="comment">//   (together with the correct exponent) then reading this number will give</span></div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;  <span class="comment">//   &#39;v&#39; again. The buffer will choose the representation that is closest to</span></div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;  <span class="comment">//   &#39;v&#39;. If there are two at the same distance, than the one farther away</span></div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;  <span class="comment">//   from 0 is chosen (halfway cases - ending with 5 - are rounded up).</span></div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  <span class="comment">//   In this mode the &#39;requested_digits&#39; parameter is ignored.</span></div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  <span class="comment">//  - SHORTEST_SINGLE: same as SHORTEST but with single-precision.</span></div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;  <span class="comment">//  - FIXED: produces digits necessary to print a given number with</span></div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  <span class="comment">//   &#39;requested_digits&#39; digits after the decimal point. The produced digits</span></div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;  <span class="comment">//   might be too short in which case the caller has to fill the remainder</span></div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;  <span class="comment">//   with &#39;0&#39;s.</span></div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  <span class="comment">//   Example: toFixed(0.001, 5) is allowed to return buffer=&quot;1&quot;, point=-2.</span></div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  <span class="comment">//   Halfway cases are rounded towards +/-Infinity (away from 0). The call</span></div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;  <span class="comment">//   toFixed(0.15, 2) thus returns buffer=&quot;2&quot;, point=0.</span></div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;  <span class="comment">//   The returned buffer may contain digits that would be truncated from the</span></div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;  <span class="comment">//   shortest representation of the input.</span></div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;  <span class="comment">//  - PRECISION: produces &#39;requested_digits&#39; where the first digit is not &#39;0&#39;.</span></div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;  <span class="comment">//   Even though the length of produced digits usually equals</span></div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;  <span class="comment">//   &#39;requested_digits&#39;, the function is allowed to return fewer digits, in</span></div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;  <span class="comment">//   which case the caller has to fill the missing digits with &#39;0&#39;s.</span></div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  <span class="comment">//   Halfway cases are again rounded away from 0.</span></div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;  <span class="comment">// DoubleToAscii expects the given buffer to be big enough to hold all</span></div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  <span class="comment">// digits and a terminating null-character. In SHORTEST-mode it expects a</span></div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  <span class="comment">// buffer of at least kBase10MaximalLength + 1. In all other modes the</span></div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;  <span class="comment">// requested_digits parameter and the padding-zeroes limit the size of the</span></div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="comment">// output. Don&#39;t forget the decimal point, the exponent character and the</span></div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <span class="comment">// terminating null-character when computing the maximal output size.</span></div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;  <span class="comment">// The given length is only used in debug mode to ensure the buffer is big</span></div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  <span class="comment">// enough.</span></div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a03348db4f5288dc63f1756d5af6630ed">DoubleToAscii</a>(<span class="keywordtype">double</span> v,</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;                            <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3">DtoaMode</a> mode,</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;                            <span class="keywordtype">int</span> requested_digits,</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;                            <span class="keywordtype">char</span>* buffer,</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;                            <span class="keywordtype">int</span> buffer_length,</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;                            <span class="keywordtype">bool</span>* sign,</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;                            <span class="keywordtype">int</span>* length,</div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;                            <span class="keywordtype">int</span>* point);</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;  <span class="comment">// Implementation for ToShortest and ToShortestSingle.</span></div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;  <span class="keywordtype">bool</span> ToShortestIeeeNumber(<span class="keywordtype">double</span> value,</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;                            <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder,</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;                            <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3">DtoaMode</a> mode) <span class="keyword">const</span>;</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;  <span class="comment">// If the value is a special value (NaN or Infinity) constructs the</span></div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;  <span class="comment">// corresponding string using the configured infinity/nan-symbol.</span></div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;  <span class="comment">// If either of them is NULL or the value is not special then the</span></div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  <span class="comment">// function returns false.</span></div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;  <span class="keywordtype">bool</span> HandleSpecialValues(<span class="keywordtype">double</span> value, <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder) <span class="keyword">const</span>;</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;  <span class="comment">// Constructs an exponential representation (i.e. 1.234e56).</span></div><div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;  <span class="comment">// The given exponent assumes a decimal point after the first decimal digit.</span></div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;  <span class="keywordtype">void</span> CreateExponentialRepresentation(<span class="keyword">const</span> <span class="keywordtype">char</span>* decimal_digits,</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;                                       <span class="keywordtype">int</span> length,</div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;                                       <span class="keywordtype">int</span> exponent,</div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;                                       <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder) <span class="keyword">const</span>;</div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;  <span class="comment">// Creates a decimal representation (i.e 1234.5678).</span></div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;  <span class="keywordtype">void</span> CreateDecimalRepresentation(<span class="keyword">const</span> <span class="keywordtype">char</span>* decimal_digits,</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;                                   <span class="keywordtype">int</span> length,</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;                                   <span class="keywordtype">int</span> decimal_point,</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;                                   <span class="keywordtype">int</span> digits_after_point,</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;                                   <a class="code" href="classdouble__conversion_1_1_string_builder.html">StringBuilder</a>* result_builder) <span class="keyword">const</span>;</div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> flags_;</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> infinity_symbol_;</div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> nan_symbol_;</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">char</span> exponent_character_;</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> decimal_in_shortest_low_;</div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> decimal_in_shortest_high_;</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> max_leading_padding_zeroes_in_precision_mode_;</div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> max_trailing_padding_zeroes_in_precision_mode_;</div><div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;</div><div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  DISALLOW_IMPLICIT_CONSTRUCTORS(<a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html">DoubleToStringConverter</a>);</div><div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;};</div><div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;</div><div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;</div><div class="line"><a name="l00381"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html">  381</a></span>&#160;<span class="keyword">class </span><a class="code" href="classdouble__conversion_1_1_string_to_double_converter.html">StringToDoubleConverter</a> {</div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;  <span class="comment">// Enumeration for allowing octals and ignoring junk when converting</span></div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  <span class="comment">// strings to numbers.</span></div><div class="line"><a name="l00385"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2">  385</a></span>&#160;  <span class="keyword">enum</span> <a class="code" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2">Flags</a> {</div><div class="line"><a name="l00386"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2ab1b2859fd50ed533d7f43c11af0b3f2f">  386</a></span>&#160;    <a class="code" href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa23cb197875ffb876257ffa1749e266d">NO_FLAGS</a> = 0,</div><div class="line"><a name="l00387"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2a15cc30cb0f2ea1b996c70b5a0301af41">  387</a></span>&#160;    ALLOW_HEX = 1,</div><div class="line"><a name="l00388"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2a85c1eebc527e8958cb4caeb01fc9a302">  388</a></span>&#160;    ALLOW_OCTALS = 2,</div><div class="line"><a name="l00389"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2a18ce0f6470f6d10e8a4d64e10f51aa21">  389</a></span>&#160;    ALLOW_TRAILING_JUNK = 4,</div><div class="line"><a name="l00390"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2a7e2107ed7efbbafe1adc3c04d6a2a51d">  390</a></span>&#160;    ALLOW_LEADING_SPACES = 8,</div><div class="line"><a name="l00391"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2ac6895efdc99327e4101672faee25a548">  391</a></span>&#160;    ALLOW_TRAILING_SPACES = 16,</div><div class="line"><a name="l00392"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2ad9f172d7520dfbd60ddfbc7b7edf4909">  392</a></span>&#160;    ALLOW_SPACES_AFTER_SIGN = 32</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;  };</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;  <span class="comment">// Flags should be a bit-or combination of the possible Flags-enum.</span></div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;  <span class="comment">//  - NO_FLAGS: no special flags.</span></div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;  <span class="comment">//  - ALLOW_HEX: recognizes the prefix &quot;0x&quot;. Hex numbers may only be integers.</span></div><div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;  <span class="comment">//      Ex: StringToDouble(&quot;0x1234&quot;) -&gt; 4660.0</span></div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;  <span class="comment">//          In StringToDouble(&quot;0x1234.56&quot;) the characters &quot;.56&quot; are trailing</span></div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;  <span class="comment">//          junk. The result of the call is hence dependent on</span></div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;  <span class="comment">//          the ALLOW_TRAILING_JUNK flag and/or the junk value.</span></div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;  <span class="comment">//      With this flag &quot;0x&quot; is a junk-string. Even with ALLOW_TRAILING_JUNK,</span></div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;  <span class="comment">//      the string will not be parsed as &quot;0&quot; followed by junk.</span></div><div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;  <span class="comment">//  - ALLOW_OCTALS: recognizes the prefix &quot;0&quot; for octals:</span></div><div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;  <span class="comment">//      If a sequence of octal digits starts with &#39;0&#39;, then the number is</span></div><div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;  <span class="comment">//      read as octal integer. Octal numbers may only be integers.</span></div><div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;  <span class="comment">//      Ex: StringToDouble(&quot;01234&quot;) -&gt; 668.0</span></div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;  <span class="comment">//          StringToDouble(&quot;012349&quot;) -&gt; 12349.0  // Not a sequence of octal</span></div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;  <span class="comment">//                                               // digits.</span></div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;  <span class="comment">//          In StringToDouble(&quot;01234.56&quot;) the characters &quot;.56&quot; are trailing</span></div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;  <span class="comment">//          junk. The result of the call is hence dependent on</span></div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;  <span class="comment">//          the ALLOW_TRAILING_JUNK flag and/or the junk value.</span></div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;  <span class="comment">//          In StringToDouble(&quot;01234e56&quot;) the characters &quot;e56&quot; are trailing</span></div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;  <span class="comment">//          junk, too.</span></div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;  <span class="comment">//  - ALLOW_TRAILING_JUNK: ignore trailing characters that are not part of</span></div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;  <span class="comment">//      a double literal.</span></div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;  <span class="comment">//  - ALLOW_LEADING_SPACES: skip over leading spaces.</span></div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;  <span class="comment">//  - ALLOW_TRAILING_SPACES: ignore trailing spaces.</span></div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;  <span class="comment">//  - ALLOW_SPACES_AFTER_SIGN: ignore spaces after the sign.</span></div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;  <span class="comment">//       Ex: StringToDouble(&quot;-   123.2&quot;) -&gt; -123.2.</span></div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;  <span class="comment">//           StringToDouble(&quot;+   123.2&quot;) -&gt; 123.2</span></div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;  <span class="comment">// empty_string_value is returned when an empty string is given as input.</span></div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;  <span class="comment">// If ALLOW_LEADING_SPACES or ALLOW_TRAILING_SPACES are set, then a string</span></div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;  <span class="comment">// containing only spaces is converted to the &#39;empty_string_value&#39;, too.</span></div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;  <span class="comment">// junk_string_value is returned when</span></div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;  <span class="comment">//  a) ALLOW_TRAILING_JUNK is not set, and a junk character (a character not</span></div><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;  <span class="comment">//     part of a double-literal) is found.</span></div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;  <span class="comment">//  b) ALLOW_TRAILING_JUNK is set, but the string does not start with a</span></div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;  <span class="comment">//     double literal.</span></div><div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;  <span class="comment">// infinity_symbol and nan_symbol are strings that are used to detect</span></div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;  <span class="comment">// inputs that represent infinity and NaN. They can be null, in which case</span></div><div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;  <span class="comment">// they are ignored.</span></div><div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;  <span class="comment">// The conversion routine first reads any possible signs. Then it compares the</span></div><div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;  <span class="comment">// following character of the input-string with the first character of</span></div><div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;  <span class="comment">// the infinity, and nan-symbol. If either matches, the function assumes, that</span></div><div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;  <span class="comment">// a match has been found, and expects the following input characters to match</span></div><div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;  <span class="comment">// the remaining characters of the special-value symbol.</span></div><div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;  <span class="comment">// This means that the following restrictions apply to special-value symbols:</span></div><div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;  <span class="comment">//  - they must not start with signs (&#39;+&#39;, or &#39;-&#39;),</span></div><div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;  <span class="comment">//  - they must not have the same first character.</span></div><div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;  <span class="comment">//  - they must not start with digits.</span></div><div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;  <span class="comment">// Examples:</span></div><div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;  <span class="comment">//  flags = ALLOW_HEX | ALLOW_TRAILING_JUNK,</span></div><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;  <span class="comment">//  empty_string_value = 0.0,</span></div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;  <span class="comment">//  junk_string_value = NaN,</span></div><div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;  <span class="comment">//  infinity_symbol = &quot;infinity&quot;,</span></div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;  <span class="comment">//  nan_symbol = &quot;nan&quot;:</span></div><div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;  <span class="comment">//    StringToDouble(&quot;0x1234&quot;) -&gt; 4660.0.</span></div><div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;  <span class="comment">//    StringToDouble(&quot;0x1234K&quot;) -&gt; 4660.0.</span></div><div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;  <span class="comment">//    StringToDouble(&quot;&quot;) -&gt; 0.0  // empty_string_value.</span></div><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;  <span class="comment">//    StringToDouble(&quot; &quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;  <span class="comment">//    StringToDouble(&quot; 1&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;  <span class="comment">//    StringToDouble(&quot;0x&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;  <span class="comment">//    StringToDouble(&quot;-123.45&quot;) -&gt; -123.45.</span></div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;  <span class="comment">//    StringToDouble(&quot;--123.45&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;  <span class="comment">//    StringToDouble(&quot;123e45&quot;) -&gt; 123e45.</span></div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;  <span class="comment">//    StringToDouble(&quot;123E45&quot;) -&gt; 123e45.</span></div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;  <span class="comment">//    StringToDouble(&quot;123e+45&quot;) -&gt; 123e45.</span></div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;  <span class="comment">//    StringToDouble(&quot;123E-45&quot;) -&gt; 123e-45.</span></div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;  <span class="comment">//    StringToDouble(&quot;123e&quot;) -&gt; 123.0  // trailing junk ignored.</span></div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;  <span class="comment">//    StringToDouble(&quot;123e-&quot;) -&gt; 123.0  // trailing junk ignored.</span></div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;  <span class="comment">//    StringToDouble(&quot;+NaN&quot;) -&gt; NaN  // NaN string literal.</span></div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;  <span class="comment">//    StringToDouble(&quot;-infinity&quot;) -&gt; -inf.  // infinity literal.</span></div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;  <span class="comment">//    StringToDouble(&quot;Infinity&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;  <span class="comment">//</span></div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;  <span class="comment">//  flags = ALLOW_OCTAL | ALLOW_LEADING_SPACES,</span></div><div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;  <span class="comment">//  empty_string_value = 0.0,</span></div><div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;  <span class="comment">//  junk_string_value = NaN,</span></div><div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;  <span class="comment">//  infinity_symbol = NULL,</span></div><div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;  <span class="comment">//  nan_symbol = NULL:</span></div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;  <span class="comment">//    StringToDouble(&quot;0x1234&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;  <span class="comment">//    StringToDouble(&quot;01234&quot;) -&gt; 668.0.</span></div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;  <span class="comment">//    StringToDouble(&quot;&quot;) -&gt; 0.0  // empty_string_value.</span></div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;  <span class="comment">//    StringToDouble(&quot; &quot;) -&gt; 0.0  // empty_string_value.</span></div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;  <span class="comment">//    StringToDouble(&quot; 1&quot;) -&gt; 1.0</span></div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;  <span class="comment">//    StringToDouble(&quot;0x&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;  <span class="comment">//    StringToDouble(&quot;0123e45&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;  <span class="comment">//    StringToDouble(&quot;01239E45&quot;) -&gt; 1239e45.</span></div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;  <span class="comment">//    StringToDouble(&quot;-infinity&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;  <span class="comment">//    StringToDouble(&quot;NaN&quot;) -&gt; NaN  // junk_string_value.</span></div><div class="line"><a name="l00486"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a7237357572cf463b84f32fea8aad9d8f">  486</a></span>&#160;  <a class="code" href="classdouble__conversion_1_1_string_to_double_converter.html#a7237357572cf463b84f32fea8aad9d8f">StringToDoubleConverter</a>(<span class="keywordtype">int</span> flags,</div><div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;                          <span class="keywordtype">double</span> empty_string_value,</div><div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;                          <span class="keywordtype">double</span> junk_string_value,</div><div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;                          <span class="keyword">const</span> <span class="keywordtype">char</span>* infinity_symbol,</div><div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;                          <span class="keyword">const</span> <span class="keywordtype">char</span>* nan_symbol)</div><div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;      : flags_(flags),</div><div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;        empty_string_value_(empty_string_value),</div><div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;        junk_string_value_(junk_string_value),</div><div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;        infinity_symbol_(infinity_symbol),</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;        nan_symbol_(nan_symbol) {</div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;  }</div><div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;</div><div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;  <span class="comment">// Performs the conversion.</span></div><div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;  <span class="comment">// The output parameter &#39;processed_characters_count&#39; is set to the number</span></div><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;  <span class="comment">// of characters that have been processed to read the number.</span></div><div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;  <span class="comment">// Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included</span></div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;  <span class="comment">// in the &#39;processed_characters_count&#39;. Trailing junk is never included.</span></div><div class="line"><a name="l00503"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#a480845e16582418fda5474e917352154">  503</a></span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classdouble__conversion_1_1_string_to_double_converter.html#a480845e16582418fda5474e917352154">StringToDouble</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* buffer,</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;                        <span class="keywordtype">int</span> length,</div><div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;                        <span class="keywordtype">int</span>* processed_characters_count)<span class="keyword"> const </span>{</div><div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;    <span class="keywordflow">return</span> StringToIeee(buffer, length, processed_characters_count, <span class="keyword">true</span>);</div><div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;  }</div><div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;</div><div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;  <span class="comment">// Same as StringToDouble but reads a float.</span></div><div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;  <span class="comment">// Note that this is not equivalent to static_cast&lt;float&gt;(StringToDouble(...))</span></div><div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;  <span class="comment">// due to potential double-rounding.</span></div><div class="line"><a name="l00512"></a><span class="lineno"><a class="line" href="classdouble__conversion_1_1_string_to_double_converter.html#ac6d34ac954f71f670a3532084a8b6251">  512</a></span>&#160;  <span class="keywordtype">float</span> <a class="code" href="classdouble__conversion_1_1_string_to_double_converter.html#ac6d34ac954f71f670a3532084a8b6251">StringToFloat</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* buffer,</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;                      <span class="keywordtype">int</span> length,</div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;                      <span class="keywordtype">int</span>* processed_characters_count)<span class="keyword"> const </span>{</div><div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(StringToIeee(buffer, length,</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;                                           processed_characters_count, <span class="keyword">false</span>));</div><div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;  }</div><div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;</div><div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">int</span> flags_;</div><div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">double</span> empty_string_value_;</div><div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">double</span> junk_string_value_;</div><div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> infinity_symbol_;</div><div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> nan_symbol_;</div><div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;</div><div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;  <span class="keywordtype">double</span> StringToIeee(<span class="keyword">const</span> <span class="keywordtype">char</span>* buffer,</div><div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;                      <span class="keywordtype">int</span> length,</div><div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;                      <span class="keywordtype">int</span>* processed_characters_count,</div><div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;                      <span class="keywordtype">bool</span> read_as_double) <span class="keyword">const</span>;</div><div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;</div><div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;  <a class="code" href="utils_8h.html#acfd97435e2829938f396946b00559b71">DISALLOW_IMPLICIT_CONSTRUCTORS</a>(<a class="code" href="classdouble__conversion_1_1_string_to_double_converter.html">StringToDoubleConverter</a>);</div><div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;};</div><div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;</div><div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;}  <span class="comment">// namespace double_conversion</span></div><div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;</div><div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;<span class="preprocessor">#endif  // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_</span></div><div class="ttc" id="utils_8h_html_acfd97435e2829938f396946b00559b71"><div class="ttname"><a href="utils_8h.html#acfd97435e2829938f396946b00559b71">DISALLOW_IMPLICIT_CONSTRUCTORS</a></div><div class="ttdeci">#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)</div><div class="ttdef"><b>Definition:</b> utils.h:124</div></div>
<div class="ttc" id="utils_8h_html_a1dfb2cb545fa51edb2760047aa4ce45f"><div class="ttname"><a href="utils_8h.html#a1dfb2cb545fa51edb2760047aa4ce45f">ASSERT</a></div><div class="ttdeci">#define ASSERT(condition)        </div><div class="ttdef"><b>Definition:</b> utils.h:36</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a5e5a815a4ce72d8d8096b73a88492bd3"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3">double_conversion::DoubleToStringConverter::DtoaMode</a></div><div class="ttdeci">DtoaMode</div><div class="ttdef"><b>Definition:</b> double-conversion.h:274</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a49052275a0e31cd9219f645b92e0fda8"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a49052275a0e31cd9219f645b92e0fda8">double_conversion::DoubleToStringConverter::kMinPrecisionDigits</a></div><div class="ttdeci">static const int kMinPrecisionDigits</div><div class="ttdef"><b>Definition:</b> double-conversion.h:50</div></div>
<div class="ttc" id="classdouble__conversion_1_1_string_to_double_converter_html_a4053daa2408fce094ed3f1eead0088f2"><div class="ttname"><a href="classdouble__conversion_1_1_string_to_double_converter.html#a4053daa2408fce094ed3f1eead0088f2">double_conversion::StringToDoubleConverter::Flags</a></div><div class="ttdeci">Flags</div><div class="ttdef"><b>Definition:</b> double-conversion.h:385</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a5e5a815a4ce72d8d8096b73a88492bd3ac31849518ec61610019f7a307857b8f1"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3ac31849518ec61610019f7a307857b8f1">double_conversion::DoubleToStringConverter::FIXED</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:284</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a394128cc38ee249932d9453ffa2a08e1"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a394128cc38ee249932d9453ffa2a08e1">double_conversion::DoubleToStringConverter::ToShortestSingle</a></div><div class="ttdeci">bool ToShortestSingle(float value, StringBuilder *result_builder) const </div><div class="ttdef"><b>Definition:</b> double-conversion.h:162</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html">double_conversion::DoubleToStringConverter</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:35</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a7fd15aba1b4cc7dc1f630e6ce5f88f4e"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a7fd15aba1b4cc7dc1f630e6ce5f88f4e">double_conversion::DoubleToStringConverter::kMaxPrecisionDigits</a></div><div class="ttdeci">static const int kMaxPrecisionDigits</div><div class="ttdef"><b>Definition:</b> double-conversion.h:51</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac57e7c75011add9f0e791250930d9eb1"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac57e7c75011add9f0e791250930d9eb1">double_conversion::DoubleToStringConverter::DoubleToStringConverter</a></div><div class="ttdeci">DoubleToStringConverter(int flags, const char *infinity_symbol, const char *nan_symbol, char exponent_character, int decimal_in_shortest_low, int decimal_in_shortest_high, int max_leading_padding_zeroes_in_precision_mode, int max_trailing_padding_zeroes_in_precision_mode)</div><div class="ttdef"><b>Definition:</b> double-conversion.h:107</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac9c23db30cb4589647e556d3e3e60ac5a7aa7eb79de1512c515e0cef5fd92706b"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a7aa7eb79de1512c515e0cef5fd92706b">double_conversion::DoubleToStringConverter::EMIT_TRAILING_ZERO_AFTER_POINT</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:57</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a7720bd00f846c4b611ce29ffabe38bdb"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a7720bd00f846c4b611ce29ffabe38bdb">double_conversion::DoubleToStringConverter::EcmaScriptConverter</a></div><div class="ttdeci">static const DoubleToStringConverter &amp; EcmaScriptConverter()</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a5e5a815a4ce72d8d8096b73a88492bd3aa19c7e5b00f4cb5fe99b46431c4b22da"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3aa19c7e5b00f4cb5fe99b46431c4b22da">double_conversion::DoubleToStringConverter::PRECISION</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:286</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a67a05fb2ae7722ac4ef220d9b1208c0b"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a67a05fb2ae7722ac4ef220d9b1208c0b">double_conversion::DoubleToStringConverter::ToFixed</a></div><div class="ttdeci">bool ToFixed(double value, int requested_digits, StringBuilder *result_builder) const </div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac9c23db30cb4589647e556d3e3e60ac5a65983b38e8e766c8de54054d392c1a74"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a65983b38e8e766c8de54054d392c1a74">double_conversion::DoubleToStringConverter::UNIQUE_ZERO</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:58</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a1e0a61262e4277a213e3076dff0de8a7"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a1e0a61262e4277a213e3076dff0de8a7">double_conversion::DoubleToStringConverter::kMaxFixedDigitsAfterPoint</a></div><div class="ttdeci">static const int kMaxFixedDigitsAfterPoint</div><div class="ttdef"><b>Definition:</b> double-conversion.h:41</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a03348db4f5288dc63f1756d5af6630ed"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a03348db4f5288dc63f1756d5af6630ed">double_conversion::DoubleToStringConverter::DoubleToAscii</a></div><div class="ttdeci">static void DoubleToAscii(double v, DtoaMode mode, int requested_digits, char *buffer, int buffer_length, bool *sign, int *length, int *point)</div></div>
<div class="ttc" id="utils_8h_html"><div class="ttname"><a href="utils_8h.html">utils.h</a></div></div>
<div class="ttc" id="classdouble__conversion_1_1_string_to_double_converter_html"><div class="ttname"><a href="classdouble__conversion_1_1_string_to_double_converter.html">double_conversion::StringToDoubleConverter</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:381</div></div>
<div class="ttc" id="classdouble__conversion_1_1_string_to_double_converter_html_a480845e16582418fda5474e917352154"><div class="ttname"><a href="classdouble__conversion_1_1_string_to_double_converter.html#a480845e16582418fda5474e917352154">double_conversion::StringToDoubleConverter::StringToDouble</a></div><div class="ttdeci">double StringToDouble(const char *buffer, int length, int *processed_characters_count) const </div><div class="ttdef"><b>Definition:</b> double-conversion.h:503</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a5e5a815a4ce72d8d8096b73a88492bd3a1f2b5709ed846f25c003bfc005257251"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3a1f2b5709ed846f25c003bfc005257251">double_conversion::DoubleToStringConverter::SHORTEST_SINGLE</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:280</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a648b150d55851704f430fa820ab035ea"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a648b150d55851704f430fa820ab035ea">double_conversion::DoubleToStringConverter::ToShortest</a></div><div class="ttdeci">bool ToShortest(double value, StringBuilder *result_builder) const </div><div class="ttdef"><b>Definition:</b> double-conversion.h:157</div></div>
<div class="ttc" id="classdouble__conversion_1_1_string_builder_html"><div class="ttname"><a href="classdouble__conversion_1_1_string_builder.html">double_conversion::StringBuilder</a></div><div class="ttdef"><b>Definition:</b> utils.h:199</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac9c23db30cb4589647e556d3e3e60ac5"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5">double_conversion::DoubleToStringConverter::Flags</a></div><div class="ttdeci">Flags</div><div class="ttdef"><b>Definition:</b> double-conversion.h:53</div></div>
<div class="ttc" id="classdouble__conversion_1_1_string_to_double_converter_html_a7237357572cf463b84f32fea8aad9d8f"><div class="ttname"><a href="classdouble__conversion_1_1_string_to_double_converter.html#a7237357572cf463b84f32fea8aad9d8f">double_conversion::StringToDoubleConverter::StringToDoubleConverter</a></div><div class="ttdeci">StringToDoubleConverter(int flags, double empty_string_value, double junk_string_value, const char *infinity_symbol, const char *nan_symbol)</div><div class="ttdef"><b>Definition:</b> double-conversion.h:486</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac9c23db30cb4589647e556d3e3e60ac5aa23cb197875ffb876257ffa1749e266d"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa23cb197875ffb876257ffa1749e266d">double_conversion::DoubleToStringConverter::NO_FLAGS</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:54</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a3f2f70cf718ff577329b95f3b8de2375"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a3f2f70cf718ff577329b95f3b8de2375">double_conversion::DoubleToStringConverter::kMaxFixedDigitsBeforePoint</a></div><div class="ttdeci">static const int kMaxFixedDigitsBeforePoint</div><div class="ttdef"><b>Definition:</b> double-conversion.h:40</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_af05a3e2ea40c5deb8db7d17f5363b31d"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#af05a3e2ea40c5deb8db7d17f5363b31d">double_conversion::DoubleToStringConverter::kMaxExponentialDigits</a></div><div class="ttdeci">static const int kMaxExponentialDigits</div><div class="ttdef"><b>Definition:</b> double-conversion.h:45</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ab0e236bbd5927c703a1bc13692278def"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ab0e236bbd5927c703a1bc13692278def">double_conversion::DoubleToStringConverter::ToPrecision</a></div><div class="ttdeci">bool ToPrecision(double value, int precision, StringBuilder *result_builder) const </div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac9c23db30cb4589647e556d3e3e60ac5a359373be91541fe7c9323761e667e0d7"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5a359373be91541fe7c9323761e667e0d7">double_conversion::DoubleToStringConverter::EMIT_POSITIVE_EXPONENT_SIGN</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:55</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac9c23db30cb4589647e556d3e3e60ac5aa52a8d564ea15c218057ed4ccde33680"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac9c23db30cb4589647e556d3e3e60ac5aa52a8d564ea15c218057ed4ccde33680">double_conversion::DoubleToStringConverter::EMIT_TRAILING_DECIMAL_POINT</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:56</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_a5e5a815a4ce72d8d8096b73a88492bd3adf991f485278f5c50e89fcb4ff279be1"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#a5e5a815a4ce72d8d8096b73a88492bd3adf991f485278f5c50e89fcb4ff279be1">double_conversion::DoubleToStringConverter::SHORTEST</a></div><div class="ttdef"><b>Definition:</b> double-conversion.h:278</div></div>
<div class="ttc" id="namespacedouble__conversion_html"><div class="ttname"><a href="namespacedouble__conversion.html">double_conversion</a></div><div class="ttdef"><b>Definition:</b> bignum-dtoa.h:33</div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ac62cdd85f3b6dbdea23788717f702752"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ac62cdd85f3b6dbdea23788717f702752">double_conversion::DoubleToStringConverter::ToExponential</a></div><div class="ttdeci">bool ToExponential(double value, int requested_digits, StringBuilder *result_builder) const </div></div>
<div class="ttc" id="classdouble__conversion_1_1_double_to_string_converter_html_ae2c96a663b04b018b25edc5237977795"><div class="ttname"><a href="classdouble__conversion_1_1_double_to_string_converter.html#ae2c96a663b04b018b25edc5237977795">double_conversion::DoubleToStringConverter::kBase10MaximalLength</a></div><div class="ttdeci">static const int kBase10MaximalLength</div><div class="ttdef"><b>Definition:</b> double-conversion.h:295</div></div>
<div class="ttc" id="classdouble__conversion_1_1_string_to_double_converter_html_ac6d34ac954f71f670a3532084a8b6251"><div class="ttname"><a href="classdouble__conversion_1_1_string_to_double_converter.html#ac6d34ac954f71f670a3532084a8b6251">double_conversion::StringToDoubleConverter::StringToFloat</a></div><div class="ttdeci">float StringToFloat(const char *buffer, int length, int *processed_characters_count) const </div><div class="ttdef"><b>Definition:</b> double-conversion.h:512</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 18 2016 17:22:37 for XenC by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
